home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / Mesa-1.2.1 / src-glu / tess.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-05  |  2.7 KB  |  115 lines

  1. /* tess.c */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25. $Id: tess.h,v 1.5 1995/05/26 19:06:52 brianp Exp $
  26.  
  27. $Log: tess.h,v $
  28.  * Revision 1.5  1995/05/26  19:06:52  brianp
  29.  * replaced GLenum with GLUenum in tesselator error callback function
  30.  *
  31.  * Revision 1.4  1995/05/22  16:56:20  brianp
  32.  * Release 1.2
  33.  *
  34.  * Revision 1.3  1995/05/16  19:17:21  brianp
  35.  * minor changes to allow compilation with real OpenGL headers
  36.  *
  37.  * Revision 1.2  1995/04/28  20:07:08  brianp
  38.  * renamed struct GLUtriangulatorObj to struct glu_triangulator_obj
  39.  *
  40.  * Revision 1.1  1995/04/28  16:19:34  brianp
  41.  * Initial revision
  42.  *
  43.  */
  44.  
  45.  
  46. /*
  47.  * This file is part of the polygon tesselation code contributed by
  48.  * Bogdan Sikorski
  49.  */
  50.  
  51.  
  52. #include "gluP.h"
  53.  
  54. #define EPSILON 1e-06 /* epsilon for double precision compares */
  55.  
  56. typedef enum
  57. {
  58.     OXY,
  59.     OYZ,
  60.     OXZ
  61. } projection_type;
  62.  
  63. typedef struct callbacks_str
  64. {
  65.     void (*begin)( GLenum mode );
  66.     void (*edgeFlag)( GLboolean flag );
  67.     void (*vertex)( GLvoid *v );
  68.     void (*end)( void );
  69.     void (*error)( GLUenum err );
  70. } tess_callbacks;
  71.  
  72. typedef struct vertex_str
  73. {
  74.     void                *data;
  75.     GLdouble            location[3];
  76.     GLdouble            x,y;
  77.     GLboolean            edge_flag;
  78.     struct vertex_str    *shadow_vertex;
  79.     struct vertex_str    *next,*previous;
  80. } tess_vertex;
  81.  
  82. typedef struct contour_str
  83. {
  84.     GLUenum                type;
  85.     GLuint                vertex_cnt;
  86.     GLdouble            area;
  87.     GLUenum                orientation;
  88.     struct vertex_str    *vertices,*last_vertex;
  89.     struct contour_str    *next,*previous;
  90. } tess_contour;
  91.  
  92. typedef struct polygon_str
  93. {
  94.     GLuint                vertex_cnt;
  95.     GLdouble            A,B,C,D;
  96.     GLdouble            area;
  97.     GLUenum                orientation;
  98.     struct vertex_str    *vertices,*last_vertex;
  99. } tess_polygon;
  100.  
  101. struct GLUtriangulatorObj
  102. {
  103.     tess_contour        *contours,*last_contour;
  104.     GLuint                contour_cnt;
  105.     tess_callbacks        callbacks;
  106.     tess_polygon        *current_polygon;
  107.     GLUenum                error;
  108.     GLdouble            A,B,C,D;
  109.     projection_type        projection;
  110. };
  111.  
  112.  
  113. extern void tess_call_user_error(GLUtriangulatorObj *,GLUenum);
  114.  
  115.